var app = getApp()
Page({
  data:{
    current: 0,
    cakes:[{
      name:"草莓奶油蛋糕1",
      introduce:"6寸 淡奶蛋糕 黄色 红色小猪 数字蜡烛 贺卡1",
    }],
    price:[{
      money:"2.00",
    }],
    times:[{
      day:"08",
      hour:"12",
      minute:"30",
    }],
    reason:[{
      speed:"商家同意或超时未处理，系统将退款给你意或超时未处理，系统将退款",
    }],
    goback:[{
      reason:"货品已损坏",
      price:"249.00",
      explain:"送来的蛋糕坏掉了",
      time:"2017-09-09 20:23"
    }]
  },
  onPullDownRefresh: function () {
    console.log('onPullDownRefresh')
  },
  onLoad:function(options){
    var id = options.id;
    // 页面初始化 options为页面跳转所带来的参数
    var that = this;
    wx.request({
      url: 'https://www.cakeyouxuan.com/small/order/tuikuan_details',
      data: {
        id:id
      },
      method: "POST",
      header: {
        "Content-Type": "application/x-www-form-urlencoded"  //post
      },
      success: function (res) {
        console.log(res);
        that.setData({
            refund: res.data.refund,
            other: res.data.other,
        });
      },
    })
  },
  //详情页跳转
  lookdetail:function(e){
    var lookid=e.currentTarget.dataset;
    console.log(e.currentTarget.dataset.id);
    wx.navigateTo({
      url:"/pages/yiguo/detail/detail?id="+lookid.id
    })
  },
  switchSlider:function(e){
    this.setData({
      current:e.target.dataset.index
    })
  },
  changeSlider:function(e){
    this.setData({
      current: e.detail.current
    })
  },
  onReady:function(){
    // 页面渲染完成
  },
  onShow:function(){
    // 页面显示
  },
  onHide:function(){
    // 页面隐藏
  },
  onUnload:function(){
    // 页面关闭
  }

})
